home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000131_icon-group-sender_Tue Oct 31 08:51:18 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9VFlGd29386
for icon-group-addresses; Tue, 31 Oct 2000 08:47:16 -0700 (MST)
Message-Id: <200010311547.e9VFlGd29386@baskerville.CS.Arizona.EDU>
From: Nevin Liber <nevin@spies.com>
Subject: Re: How would the experts handle this...??
To: symbiot@my-deja.com
Date: Mon, 30 Oct 2000 15:36:44 -0800 (PST)
Cc: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1539
symbiot@my-deja.com wrote:
> I wish to scan thru a file and determine how letters "connect" with one
> another. By that I mean that for every letter of the alphabet, I would
> like to compile two lists: one containing all the letters which apper
> to the right of the given letter, and another for all those appearing
> to the left.
My first pass (I'm doing it only on one string; a little more work
is needed to have this work on a whole file, sort the output, etc.)
would be something like:
procedure Connect(s)
local TLeft
local TRight
local sRight
local sMiddle
local sLeft
TLeft := table('')
TRight := table('')
s ? {
sRight := move(1)
while sMiddle := \sRight do {
sRight := move(1) | &null
TLeft[sMiddle] ++:= \sLeft
TRight[sMiddle] ++:= \sRight
sLeft := sMiddle
}
}
write(image(s))
write("Left")
every sMiddle := key(TLeft) do
write(image(sMiddle), "\t", image(TLeft[sMiddle]))
write()
write("Right")
every sMiddle := key(TRight) do
write(image(sMiddle), "\t", image(TRight[sMiddle]))
end
> "Cable television programming is...."
My output would be:
"Cable television programming is..."
Left
"s" 'i'
" " 'egn'
"p" ' '
"e" 'lt'
"m" 'am'
"b" 'a'
"r" 'gp'
"g" 'no'
"o" 'ir'
"l" 'be'
"t" ' '
"a" 'Cr'
"i" ' msv'
"." '.s'
"n" 'io'
"v" 'e'
Right
"C" 'a'
"s" '.i'
" " 'ipt'
"p" 'r'
"e" ' lv'
"m" 'im'
"b" 'l'
"r" 'ao'
"g" ' r'
"o" 'gn'
"l" 'e'
"t" 'e'
"a" 'bm'
"i" 'nos'
"." '.'
"n" ' g'
"v" 'i'
--
Nevin ":-)" Liber <mailto:nevin@spies.com> (773) 961-2479